﻿using QFramework.Framework.ResKit.Res;

namespace QFramework.Framework.ResKit
{
    /// <summary>
    ///     Res 工厂类
    /// </summary>
    public class ResFactory
    {
        public static Res.Res CreateRes(string assetName, string assetBundleName)
        {
            Res.Res res = null;

            if (assetBundleName != null)
                res = new AssetRes(assetName, assetBundleName);
            else if (assetName.StartsWith("resources://"))
                res = new ResourcesRes(assetName);
            else
                res = new AssetBundleRes(assetName);

            return res;
        }
    }
}